source('coutinho.R')

sizes <- seq(50,700,50)
times <- NULL
niter <- 10

for(L in sizes) {
	times <- c(times, coutinho(niter-1, L, benchmark=TRUE)/niter)
	print(paste(L, times[length(times)]))
}

plot(sizes, times)
lines(sizes, times)

# times <- c(0.1192,0.4535,1.0328,1.8377,2.8510,4.1207,5.6829,7.3454,9.2369,11.2716,13.9195,16.5206,19.3434,22.6466) * 625 / 3600

library(ggplot2)
theme_set(theme_classic() +
	theme(text=element_text('serif')) +
	theme(strip.background=element_blank()) +
	theme(strip.text.x=element_text(face='bold',size=12)))

p <- ggplot(data.frame(sizes=sizes, times=times), aes(x=sizes, y=times)) +
	geom_line() +
	geom_point(size=2, shape=21, fill='white') +
	ylab("time per run (hours)") +
	scale_x_continuous("L", breaks=seq(100,700,100))
print(p)
ggsave('/home/rick2/Documentos/engmat/hiv/latex/chp3/time.pdf', p, width=6, height=3)
